package com.zff.rental.utils.sql.impl;

import com.zff.rental.utils.sql.From;
import com.zff.rental.utils.sql.FromNext;

/**
 * @author HCY
 */
class FromImpl extends SqlContextHolder implements From {
    public FromImpl(SqlContext sqlContext) {
        super(sqlContext);
    }

    @Override
    public FromNext from(String table, String tableAlias) {
        sqlContext.getSql().append(" FROM ").append(table);
        if (tableAlias != null) {
            sqlContext.getSql().append(" AS ").append(tableAlias);
        }
        return sqlContext.getFromNext();
    }
}
